#include <stdio.h>
#include <stdlib.h>  /* malloc, free, rand, system */

#define InitSize 10

typedef struct{
	int *data;
	int Maxsize;
	int length;
}SeqList;


void InitList(SeqList &L)
{
	L.data = (int*)malloc(InitSize * sizeof(int));
	L.length = 0;
	L.Maxsize = InitSize;
}

void IncreaseSize(SeqList &L, int len)
{
	int *p = L.data;
	L.data = (int *)malloc( (L.Maxsize+len) * sizeof(int));
	for(int i = 0; i<L.length; i++){
		L.data[i] = p[i];
	}
	L.Maxsize = L.Maxsize + len;
	free(p);
}
void PrintList(SeqList L)
{
	for(int i=0; i<L.Maxsize; i++)
	{
		printf("%d\n",L.data[i]);
	}
	
}

int main(){
	SeqList L;
	InitList(L);
	IncreaseSize(L, 5);
	PrintList(L);
	return 0;	
}
